<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: shanpengfei
  Date: 2019/2/28
  Time: 5:58 PM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:set var="basePath" value="/zyz"></c:set>
<style>
    .user-list-content .user-list-item {
        width: 240px;
        margin: 20px;
        padding: 10px;
        border-radius: 10px;
        background: rgb(253, 254, 239);
    }
    .user-list-content .user-list-item .item-text {
        line-height: 22px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .user-list-page {
        clear: both;
        padding-bottom: 80px;
    }
    .user-list-page span {
        width: 30px;
        text-align: center;
    }
    input {
        width: 200px;
        height: 30px;
        margin: 5px 20px;
    }
</style>

<jsp:include page="../template_header.jsp"></jsp:include>

<div class="user-list-content">
    <form action="${basePath}/user/1" method="get">
        <input type="text" name="username" placeholder="志愿者名">
        <input type="text" name="name" placeholder="姓名">
        <input type="phone" name="phone" placeholder="联系电话">
        <input type="submit" value="查询">
    </form>
    <c:forEach items="${page.list}" var="list">
        <div class="user-list-item fl">
            <img src="${list.pic}" width="240" height="240">

            <div class="item-text" title="${list.username}">用户名：${list.username}</div>
            <div class="item-text" title="${list.name}">姓名：${list.name}</div>
            <div class="item-text" title="${list.sex==1?'男':'女'}">性别：${list.sex==1?'男':'女'}</div>
            <div class="item-text" title="${list.birthday}">出生日期：${list.birthday}</div>
            <div class="item-text" title="${list.phone}">联系电话：${list.phone}</div>
            <div class="item-text" title="${list.email}">邮箱：${list.email}</div>
            <div class="item-text" title="<fmt:formatDate value="${list.createAt }" pattern="yyyy-MM-dd"/>">注册时间：<fmt:formatDate value="${list.createAt }" pattern="yyyy-MM-dd"/></div>
            <ul class="item-text">
                <c:if test="${sessionScope.user.username=='admin'}">
                    <li class="item-text-item fl"><a href="${basePath}/user/del/${list.id}">取消志愿者资格</a></li>
                </c:if>
                <li class="clear"></li>
            </ul>
        </div>
    </c:forEach>
    <div class="clear"></div>
</div>

<ul class="user-list-page">
    <c:if test="${!page.isFirstPage}">
        <li class="fl"><a href="${basePath}/user/1">首页</a></li>
    </c:if>
    <c:if test="${page.hasPreviousPage}">
        <li class="fl"><a href="${basePath}/user/${page.pageNum-1}">上一页</a></li>
    </c:if>
    <span class="fl">${page.pageNum}</span>
    <c:if test="${page.hasNextPage}">
        <li class="fl"><a href="${basePath}/user/${page.pageNum+1}">下一页</a></li>
    </c:if>
    <c:if test="${!page.isLastPage}">
        <li class="fl"><a href="${basePath}/user/${page.pages}">尾页</a></li>
    </c:if>
    <li class="clear"></li>
</ul>

<jsp:include page="../template_footer.jsp"></jsp:include>
